import request from '../../utils/request'

//1.查询所有的学生
export function findAllStudents() {
    return request({
        url: "student?cmd=list",
        method: "get"
    });
}

//2.分页查询学生
export function findByPage(page, pageSize) {
    return request({
        url:`student?cmd=findByPage&page=${page}&pageSize=${pageSize}`,
        method:'get'
    })
}

//3.条件查询带分页
export function search(page, pageSize, keywords) {
    return request({
        url:`student?cmd=search&page=${page}&pageSize=${pageSize}&keywords=${keywords}`,
        method:'get'
    })
}

//4.保存学生
export function save(url,student) {
    return request({
        url:url,
        method:'post',
        data:student
    })
}

//5.根据学号删除学生
export function deleteStudent(sid) {
    return request({
        url:`/student?cmd=delete&sid=${sid}`,
        method:'get'
    })
}